King Adoni-zedek of Jerusalem eventually heard how Joshua had conquered Ai, utterly destroying it, doing to Ai and its king the same thing that he had done to Jericho and its king, and how the inhabitants of Gibeon had made peace with Israel and were now living among them. So they were terrified, since Gibeon was a large city, comparable to one of the royal cities, was larger than Ai, and all of its men had been warriors. read more.
So King Adoni-zedek of Jerusalem sent word to King Hoham of Hebron, King Piram of Jarmuth, King Japhia of Lachish, and King Debir of Eglon. He told them, "Come over and help me, and let's attack Gibeon, because it made a peace treaty with Joshua and the Israelis." So the five kings of the Amorites the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon gathered their armies together and advanced with all of their armies toward Gideon, camped there, and laid siege to it. The Gibeonites sent word to Joshua at his camp in Gilgal: "Don't abandon your servants. Come quickly, save us, and help us, because all of the kings of the Amorites who live in the hill country have attacked us." So Joshua went up from Gilgal, along with his entire fighting force of mighty warriors with him. The LORD told Joshua, "Don't fear them, because I have handed them over to you. Not one of them will withstand you." So after an all-night march from Gilgal, Joshua attacked them by surprise. The LORD threw the Amorites into a panic right in front of the army of Israel, which then slaughtered many of them at Gibeon. The Israeli army chased them along the road that goes up to Beth-horon, striking them down as far as Azekah and Makkedah. While they were fleeing in front of Israel and descending the slope of Beth-horon, the LORD rained down huge hailstones on them as far as Azekah, and they died. More died because of the hailstones than were killed by the Israelis in battle. Later that day, Joshua spoke to the LORD while the LORD was delivering the Amorites to the Israelis. This is what he said in the presence of Israel: "Sun, be still over Gibeon! Moon, stand in place in the Aijalon Valley!" So the sun remained still and the moon stood in place until the nation settled their score with their enemies. This is recorded, is it not, in the book of Jashar? The sun stood in place in the middle of the sky and seemed not to be in a hurry to set for nearly an entire day. There has never been a day like it before or since, when the LORD listened to the voice of a man, because the LORD was fighting on behalf of Israel. After this, Joshua returned to the camp at Gilgal with the entire fighting force of Israel. Meanwhile, the five kings had fled and hidden themselves inside a cave at Makkedah. Joshua was informed, "The five kings have been discovered hiding in the cave at Makkedah." So Joshua gave an order, "Roll large stones up against the mouth of the cave and assign men to stand guard there, but don't stay there yourselves. Instead, pursue your enemies and attack them from behind. Don't allow them to enter their cities, because the LORD your God has delivered them into your control." Now it came about that after Joshua and the Israelis had finished the battle, destroying and scattering their survivors, who retreated into their fortified cities, the entire army returned safely to Joshua's encampment at Makkedah. No one could speak so much as a single word against any of the Israelis. Then Joshua gave this order: "Unseal the mouth of the cave and bring out these five kings to me from the cave." So they did. They brought out these five kings to him from within the cave: the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon. When they had brought these kings out to Joshua, Joshua called for all the men of Israel and spoke to the leaders of the men who had gone out to war along with him, "Come close and put your feet on the necks of these kings." So they came near and put their feet on their necks. Joshua told the army, "Don't fear or be dismayed! Be strong and courageous, because this is how the LORD will treat all of your enemies whom you fight." After this, Joshua struck those kings down, executing them, and hanged them on five gallows until sunset. When evening had come, Joshua gave a command to remove the bodies from the gallows and bury them in the cave where they had hidden. The army sealed the mouth of the cave with large stones that remain there to this very day.